package com.ruoyi.system.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.ruoyi.system.domain.SSubstation;
import com.ruoyi.system.domain.SSubstationDevice;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 变电站信息Mapper接口
 * 
 * @author ruoyi
 * @date 2023-07-05
 */
public interface SSubstationMapper extends BaseMapper<SSubstation>
{

    @Select("SELECT s.*, a.area_name,st.type type_name, su.nick_name leader_name  FROM s_substation s LEFT JOIN s_area a on s.area_id = a.id " +
            "LEFT JOIN s_substation_type st on s.type_id = st.id " +
            "LEFT JOIN sys_user su on su.user_id = a.user_id ${ew.customSqlSegment}")
    List<SSubstation> getList(@Param(Constants.WRAPPER) QueryWrapper<SSubstation> queryWrapper);
}
